package com.myapp.struts.menu;

import java.util.ArrayList;

public class USAllDayXML {

    private static USAllDayXML usAllDayXMLObj;
    ArrayList<FoodItems> usAllDayXMLArray = new ArrayList<FoodItems>();

    public static synchronized USAllDayXML getSingletonObject() {
        if (usAllDayXMLObj == null) {
            usAllDayXMLObj = new USAllDayXML();
        }
        return usAllDayXMLObj;
    }

    public Object clone() throws CloneNotSupportedException {
        throw new CloneNotSupportedException();
    }

    public String getUSAllDayXML(String fileLoc) {
        String fileName = "";
        MenuRead menuReadObj = new MenuRead();
        usAllDayXMLArray = menuReadObj.ReadMenu(Constants.US);
        
        MenuGenerate menuGenerateObj = new MenuGenerate();
        usAllDayXMLArray = menuGenerateObj.GenerateMenu(usAllDayXMLArray, Constants.ALL_DAY);

        MenuFormat menuFormatObj = new MenuFormat();
        fileName = menuFormatObj.FormatMenu(usAllDayXMLArray, Constants.XML, fileLoc);
        return fileName;
    }
}
